<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
<xsl:output method="xml"
	media-type="text/html"
	doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
	doctype-system="DTD/xhtml1-strict.dtd"
	cdata-section-elements="script style"
	indent="yes"
	encoding="UTF-8"/>

<xsl:template match="/app">
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Maps</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="http://code.google.com/apis/gears/gears_init.js"></script>
<script type="text/javascript">
var initialLocation;
var map;
var infowindow = new google.maps.InfoWindow();
  
function initialize() {
  var myOptions = {
    zoom: <xsl:value-of select="data/zoom"/>,
    mapTypeId: google.maps.MapTypeId.<xsl:value-of select="data/mapTypeId"/>,
	navigationControl: true,
  	mapTypeControl: true,
  	scaleControl: true 
  };
  map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  initialLocation = new google.maps.LatLng(<xsl:value-of select="data/lat"/>,<xsl:value-of select="data/lng"/>);
  contentString = "<xsl:value-of select="data/contentString"/>";
  label = "<xsl:value-of select="data/label"/>";
  map.setCenter(initialLocation);
  infowindow.setContent(contentString);
  infowindow.setPosition(initialLocation);
  var marker = new google.maps.Marker({
  	position: initialLocation,
    map: map,
    title: contentString
  });
  infowindow.open(map);
  google.maps.event.addListener(marker, 'click', function() {
  	infowindow.open(map,marker);
  });

}
</script>
</head>
<body onload="initialize()">
  <div id="map_canvas"></div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
